/**
 * @Description:
 * @Author BPF
 * @create 2021/8/24 18:06
 */
import NProgress from 'nprogress'
import { get, call } from '~vuex-helper'

const whiteList = [
  // 白名单
  'authorization'
]

export const routerGuard = function () {
  this.beforeEach(async (to, from, next) => {
    NProgress.start()
    if (whiteList.includes(to.name)) {
      next()
    } else {
      next()
    }
  })

  // eslint-disable-next-line no-unused-vars
  this.afterEach((to, from, next) => {
    NProgress.done()
  })
}
